package xian.woniuxy.be.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xian.woniuxy.be.dao.OrdersMapper;
import xian.woniuxy.be.dao.custom.CustomOrdersMapper;
import xian.woniuxy.be.entity.Orders;
import xian.woniuxy.be.service.IOrdersService;

import java.util.List;

/**
 * @author Gong
 * @time 2022/01/09 00:54:02
 */
@Service
@Transactional
public class OrdersServiceImpl implements IOrdersService {

    @Autowired
    private CustomOrdersMapper ordersMapper;

    @Override
    public List<Orders> findOne(int cusId) {
        List<Orders> list = ordersMapper.selectOne(cusId);

        return list;
    }

    @Override
    public void delete(int orderId) {
        ordersMapper.deleteByPrimaryKey(orderId);
    }

    @Override
    public void update(Orders orders) {
        ordersMapper.updateByPrimaryKey(orders);
    }
}
